<?php
namespace Admin\Controller;
use Admin\Controller\CommonController;
class IndexController extends CommonController {
    /**
     * 公共数据
     */
    public function common(){
        $this->ajaxReturnSuccess(self::$result);
    }
    
    /**
     * 系统导航菜单
     */
    public function menuMap(){
        //$rule_list = D('Sys', 'Cache')->getMenu('', 'admin');
        $rule_list = S('sys_menu_admin');

        if( !$rule_list || empty($rule_list) ){
            $rule_list  = self::flushedNode();
        }

        $this->ajaxReturnSuccess([
                'result'	=> $rule_list
        ]);
    }
    
    /**
     * 语言能力切换
     */
    public function langSwap(){
        self::$result['tips'] = L('LANG_SWAP_SUCCESS');
        $this->ajaxReturnSuccess(self::$result);
    }
    
    /**
     * 系统首页
     */
    public function home(){
    	$this->ajaxReturnSuccess(self::$result);
    }
}